import React,{Component} from 'react';
import {Text,Button,View} from 'react-native';

export default class Demo19PayComponent extends Component{
   constructor(){
     super();
     //初始化状态 
     this.state = {
       productPrice:0
     };
   }

   componentWillMount(){
     //接受通过跳转传递来的参数
     var price = this.props.navigation.state.params.price;

     this.setState({productPrice:price});
   }

   render(){
     return <View>
         <Text>{"商品价格为"+this.state.productPrice}</Text>
         <Text>这是商品的支付页面</Text>
         <Button title='去发货' 
         onPress={()=>this.props.navigation.navigate('send')}>
         </Button>
       </View>
      }
}